package com.cipta.lomob.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringFormatter {
	/*
	 * this function help to conver date format mm/dd/yyyy to yyyy-mm-dd
	 */
	public static String converToDateFormat(String mytime){
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "mm/dd/yyyy");
        Date myDate = null;
        try {
            myDate = dateFormat.parse(mytime);

        } catch (ParseException e) {
            e.printStackTrace();
        }

        SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-mm-dd");
        String finalDate = timeFormat.format(myDate);
        return finalDate;
	}
}
